

#ifndef __RUNNING_WORK_PROCESS_H
#define __RUNNING_WORK_PROCESS_H

#include <apr_pools.h>
#include <apr_thread_proc.h>

/** Class for running work locally and monitoring its progress. */
class RunningWorkProcess
{
   public:
      RunningWorkProcess(const char *directorypath, int instancenumber, int totalinstances, apr_pool_t *imp);
      ~RunningWorkProcess();
      int weAreFinishedYet();
   private:
      /** Name of the directory to run in. */
      char *directory_name;
      /** Memory pool for use in this class. */
      apr_pool_t *mp;
      /** Attributes for the process. */
      apr_procattr_t *pattr;
      /** Process handle. */
      apr_proc_t tproc;
      /** Process finished flag. */
      int finished;
};

#endif
